Builder

open class Builder(source)

Builder class for NotificationChannelCompat objects.

Constructors

Link copied to clipboard
constructor(@NonNull id: @NonNull String, importance: Int)
Creates a notification channel builder.

Functions

Link copied to clipboard
@NonNull
open fun build(): @NonNull NotificationChannelCompat
Creates a NotificationChannelCompat instance.
Link copied to clipboard
@NonNull
open fun setConversationId(@NonNull parentChannelId: @NonNull String, @NonNull conversationId: @NonNull String): @NonNull NotificationChannelCompat.Builder
Sets this channel as being conversation-centric.
Link copied to clipboard
@NonNull
open fun setDescription(@Nullable description: @Nullable String): @NonNull NotificationChannelCompat.Builder
Sets the user visible description of this channel.
Link copied to clipboard
@NonNull
open fun setGroup(@Nullable groupId: @Nullable String): @NonNull NotificationChannelCompat.Builder
Sets what group this channel belongs to.
Link copied to clipboard
@NonNull
open fun setImportance(importance: Int): @NonNull NotificationChannelCompat.Builder
Sets the level of interruption of this notification channel.
Link copied to clipboard
@NonNull
open fun setLightColor(argb: Int): @NonNull NotificationChannelCompat.Builder
Sets the notification light color for notifications posted to this channel, if lights are enabled on this channel and the device supports that feature.
Link copied to clipboard
@NonNull
open fun setLightsEnabled(lights: Boolean): @NonNull NotificationChannelCompat.Builder
Sets whether notifications posted to this channel should display notification lights, on devices that support that feature.
Link copied to clipboard
@NonNull
open fun setName(@Nullable name: @Nullable CharSequence): @NonNull NotificationChannelCompat.Builder
Sets the user visible name of this channel.
Link copied to clipboard
@NonNull
open fun setShowBadge(showBadge: Boolean): @NonNull NotificationChannelCompat.Builder
Sets whether notifications posted to this channel can appear as application icon badges in a Launcher.
Link copied to clipboard
@NonNull
open fun setSound(@Nullable sound: @Nullable Uri, @Nullable audioAttributes: @Nullable AudioAttributes): @NonNull NotificationChannelCompat.Builder
Sets the sound that should be played for notifications posted to this channel and its audio attributes.
Link copied to clipboard
@NonNull
open fun setVibrationEnabled(vibration: Boolean): @NonNull NotificationChannelCompat.Builder
Sets whether notification posted to this channel should vibrate.
Link copied to clipboard
@NonNull
open fun setVibrationPattern(vibrationPattern: @Nullable Array<Long>): @NonNull NotificationChannelCompat.Builder
Sets the vibration pattern for notifications posted to this channel.